package com.matt.domain.statistics;

import com.matt.foundation.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Describle This Class Is 收支预算
 * @Author ZengMin
 * @Date 2018/10/10 11:09
 */
@Data
@Entity
@Table(name = "budget_income")
@EqualsAndHashCode(callSuper = true)
public class BudgetIncome extends Domain {

    @Column(columnDefinition = " varchar(32) COMMENT '模板id' ")
    private String templeteId;

    @Column(columnDefinition = " varchar(32) COMMENT '创建人id' ")
    private String staffId;

    @Column(columnDefinition = " varchar(32) COMMENT '区域id' ")
    private String areaId;

    @Column(columnDefinition = " double COMMENT '计划支出' ")
    private Double planPay;

    @Column(columnDefinition = " double COMMENT '实际支出' ")
    private Double realPay;

    @Column(columnDefinition = " date COMMENT '月份' ")
    private String month;

    @Column(columnDefinition = " int COMMENT '父级类型：1市场2销售3运营4物业5教师6其他' ")
    private Integer parentid;

    @Column(columnDefinition = " varchar(32) COMMENT '父级类型中文' ")
    private String parentVal;

    @Column(columnDefinition = " int COMMENT '子分类 1主动2被动 只有市场才有子分类' ")
    private Integer type;

    @Column(columnDefinition = " varchar(10) COMMENT '子分类中文' ")
    private String typeVal;

    public static BudgetIncome of(String templeteId, String staffId, Double planPay, Double realPay, String month) {
        BudgetIncome budgetIncome = new BudgetIncome();
        budgetIncome.setTempleteId(templeteId);
        budgetIncome.setMonth(month);
        budgetIncome.setPlanPay(planPay);
        budgetIncome.setRealPay(realPay);
        budgetIncome.setStaffId(staffId);
        return budgetIncome;
    }
}
